how to build a dictionary app in javascript